<select name="province" id="J_province"></select>
<select name="city" id="J_city" style="display:none;"></select>
<select name="district" id="J_district" style="display:none;"></select>
<select name="community" id="J_community" style="display:none;"></select>
<script src="__ROOT__/statics/js/jquery.js"></script>
<script type="text/javascript">
$(function(){
	
	var pid=<if condition="$param.province neq ''">{$param.province}<else />0</if>;  //默认省份id
	var cid=<if condition="$param.city neq ''">{$param.city}<else />0</if>;  //默认城市id
	var did=<if condition="$param.district neq ''">{$param.district}<else />0</if>;  //默认区县市id
	var coid=<if condition="$param.community neq ''">{$param.community}<else />0</if>;  //默认乡镇id

	
	$.post("{:leuu('ChinaCity/ChinaCity/getProvince')}", {pids: pid}, function(result){
		$("#J_province").html(result);
	});

	$.post('{:leuu("ChinaCity/ChinaCity/getCity")}', {pid: pid, cid: cid}, function(result){
		$("#J_city").show().html(result);
	});

	$.post('{:leuu("ChinaCity/ChinaCity/getDistrict")}', {cid: cid, did: did}, function(result){
		$("#J_district").show().html(result);
	});

	$.post('{:leuu("ChinaCity/ChinaCity/getCommunity")}', {did: did, coid: coid}, function(result){
		$("#J_community").show().html(result);
	});

	$('#J_province').change(function(){
		var pid_g=$(this).children('option:selected').val();
		$.post('{:leuu("ChinaCity/ChinaCity/getCity")}', {pid: pid_g}, function(result){
			$("#J_city").show().html(result);
            $("#J_district").show().html('');
            $("#J_community").show().html('');
		});
	});
	
	$('#J_city').change(function(){
		var cid_g=$(this).children('option:selected').val();
		$.post('{:leuu("ChinaCity/ChinaCity/getDistrict")}', {cid: cid_g}, function(result){
			$("#J_district").show().html(result);
            $("#J_community").show().html('');
		});
	});

	$('#J_district').change(function(){
		var did_g=$(this).children('option:selected').val();
		$.post('{:leuu("ChinaCity/ChinaCity/getCommunity")}', {did: did_g}, function(result){
			$("#J_community").show().html(result);
		});
	});
	
});
</script>